package promote.brozen.algorithm.tree.binary.avl;

import lombok.Getter;
import lombok.Setter;
import promote.brozen.algorithm.tree.binary.BinaryTreeNode;

import java.util.ArrayList;

/**
 * @author Brozen
 * @date 2019/12/24 11:11 AM
 */
@Getter
@Setter
public class AVLTreeNode<K extends Comparable<K>> extends BinaryTreeNode<K, AVLTreeNode<K>> {

    private int height;

    public AVLTreeNode(K key) {
        super(key);
        children = new ArrayList<>(2);
        children.add(null);
        children.add(null);
        height = 1;
    }

    @Override
    public AVLTreeNode<K> getParent() {
        return (AVLTreeNode<K>) super.getParent();
    }

}
